package com.jdy.haoduoaiteacher.widget.progressbar;

import android.content.res.Resources;

/**
 *
 * @author zp @ 2015-5-27 下午5:15:53
 */
public class Utils {
  public static float dp2px(Resources resources, float dp) {
    final float scale = resources.getDisplayMetrics().density;
    return dp * scale + 0.5f;
  }

  public static float sp2px(Resources resources, float sp) {
    final float scale = resources.getDisplayMetrics().scaledDensity;
    return sp * scale;
  }
}
